<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>水仙花数</title>
    <script>
      function getNums(num) {
        //判断用户输入的内容是一个三位的纯数字
        if (!isNaN(num) && num.length == 3) {
          //获取个位
          let g = num % 10
          //获取十位
          let s = parseInt(num / 10) % 10
          //获取百位
          let b = parseInt(num / 100)
          //计算结果
          let result = g * g * g + s * s * s + b * b * b == num
          return result
        }
      }
    </script>
  </head>
  <body></body>
</html>
